package com.dianxin.smartpark.web.common;

import java.util.List;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.chinatelecom.response.common.CommonResponseBody;
import com.dianxin.smartpark.dao.qo.common.SmartParkServiceAddresQO;
import com.dianxin.smartpark.service.common.SmartParkServiceAddresService;
import com.dianxin.smartpark.service.vo.common.SmartParkServiceAddresVO;
import com.dianxin.sso.client.annotation.RecordLog;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 服务地址管理
 * 
 * @author chenjiasong
 * @date 2021-07-28
 */
@RestController
@RequestMapping("/smartpark/addres")
public class SmartParkServiceAddresController
{
    @Resource
    private SmartParkServiceAddresService smartParkServiceAddresService;

    /**
     * 查询服务地址管理列表
     */
    @GetMapping("/list")
    @SaCheckPermission("/smartpark/addres/list")
    public CommonResponseBody<List<SmartParkServiceAddresVO>>  list(SmartParkServiceAddresQO qo)
    {
        return smartParkServiceAddresService.selectSmartParkServiceAddresList(qo);
    }


    /**
     * 获取服务地址管理详细信息
     */
    @GetMapping(value = "/getInfo")
    @SaCheckPermission("/smartpark/addres/getInfo")
    public CommonResponseBody<SmartParkServiceAddresVO> getInfo(SmartParkServiceAddresQO qo)
    {
        return smartParkServiceAddresService.selectSmartParkServiceAddres(qo);
    }

    /**
     * 新增服务地址管理
     */
    @PostMapping("/add")
    @SaCheckPermission("/smartpark/addres/add")
    @RecordLog(name = "新增服务地址")
    public  CommonResponseBody<Boolean> add(@RequestBody SmartParkServiceAddresVO vo)
    {
        return smartParkServiceAddresService.insertSmartParkServiceAddres(vo);
    }

    /**
     * 修改服务地址管理
     */
    @PutMapping("/edit")
    @SaCheckPermission("/smartpark/addres/edit")
    @RecordLog(name = "修改服务地址")
    public  CommonResponseBody<Boolean> edit(@RequestBody SmartParkServiceAddresVO vo)
    {
        return smartParkServiceAddresService.updateSmartParkServiceAddres(vo);
    }

    /**
     * 删除服务地址管理
     */
	@DeleteMapping("/remove")
    @SaCheckPermission("/smartpark/addres/remove")
    @RecordLog(name = "删除服务地址")
    public  CommonResponseBody<Boolean> remove(@RequestBody SmartParkServiceAddresVO vo)
    {
        return smartParkServiceAddresService.deleteSmartParkServiceAddres(vo);
    }
}
